import Vue from 'vue';
const state = {
  ZRSUserInfo:null,
  routerStatus:null,
  loginBackRedirectUrL:null,
  curriculumLink:null,
  appTitle:null
}

const mutations = {
  SET_ZRS_USER_INFO: (state, info) => {
    state.ZRSUserInfo=info;
  },
  SET_ROUTER_STATUS: (state, status) => {
    state.routerStatus=status;
  },
  SET_LOGIN_BACK_REDIRECT_URL: (state, url) => {
    state.loginBackRedirectUrL=url;
  },
  SET_APP_TITLE:(state, title) => {
    state.appTitle=title;
  },
  SET_CURRICULUM_LINK:(state, url) => {
    state.curriculumLink=url;
  },
}

const actions = {
  setZrsUserInfo({ commit }, info) {
    commit('SET_ZRS_USER_INFO', info)
  },
  setRouterStatus({ commit }, status) {
    commit('SET_ROUTER_STATUS', status)
  },
  setLoginBackRedirectUrl({ commit }, url) {
    commit('SET_LOGIN_BACK_REDIRECT_URL', url)
  },
  setAppTitle({ commit }, title) {
    commit('SET_APP_TITLE', title)
  },
  setCurriculumLink({ commit }, url) {
    commit('SET_CURRICULUM_LINK', url)
  },
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
